﻿using UnityEngine;
using System.Collections.Generic;

namespace GameBasic
{
    public static class ExtDic
    {
        public static bool TryGetAs<K, T>(this Dictionary<K, Object> dic, K key, out T value) where T : Object
        {
            value = default;
            if (dic.TryGetValue(key, out Object obj))
                value = obj as T;

            return value != null;
        }
    }
}